/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EntityClass;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Ashish
 */
@Entity(name="mcase")
public class mCase implements Serializable {
    
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Id
    private Long CIN;
    @Temporal(value = TemporalType.DATE)
    private Date dateCreated;
  
    @ManyToOne
    private PIN pin;
    @OneToMany(cascade={CascadeType.ALL})
    private List<Medical_Procedure> mProcedures= new ArrayList<Medical_Procedure>();
    @OneToMany(cascade={CascadeType.ALL})
    private List<Nursing_Procedure> nProcedures= new ArrayList<Nursing_Procedure>();
    @OneToOne
    private Bed bed;
    @OneToOne
    private Transfer transfer;
    @OneToMany(cascade={CascadeType.ALL}, mappedBy="mcase")
    private List<Appointment> appointments;
    @OneToOne
    private DischargeSummary dischargeSummary;
    @OneToOne
    private Medical_Anamnesis medicalAnamnesis; 
    @OneToOne
    private Nursing_Anamnesis nursingAnamnesis; 
    
          
    /**
     *
     */
    public mCase() {}
    
    public void create(Date dateCreated) {
        this.setDateCreated(dateCreated);
    }
    
    public Long getCIN() {
        return CIN;
    }

    public void setCIN(Long CIN) {
        this.CIN = CIN;
    }
    
        public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    /**
     * @return the pin
     */
    public PIN getPin() {
        return pin;
    }

    /**
     * @param pin the pin to set
     */
    public void setPin(PIN pin) {
        this.pin = pin;
    }

    /**
     * @return the mProcedures
     */
    public List<Medical_Procedure> getmProcedures() {
        return mProcedures;
    }

    /**
     * @param mProcedures the mProcedures to set
     */
    public void setmProcedures(List<Medical_Procedure> mProcedures) {
        this.mProcedures = mProcedures;
    }

    /**
     * @return the nProcedures
     */
    public List<Nursing_Procedure> getnProcedures() {
        return nProcedures;
    }

    /**
     * @param nProcedures the nProcedures to set
     */
    public void setnProcedures(List<Nursing_Procedure> nProcedures) {
        this.nProcedures = nProcedures;
    }

    /**
     * @return the bed
     */
    public Bed getBed() {
        return bed;
    }
    
    /**
     * @param bed the bed to set
     */
    public void setBed(Bed bed) {
        this.bed = bed;
    }

    /**
     * @return the transfer
     */
    public Transfer getTransfer() {
        return transfer;
    }

    /**
     * @param transfer the transfer to set
     */
    public void setTransfer(Transfer transfer) {
        this.transfer = transfer;
    }

   
    public void addmedicaProcedure (Medical_Procedure procedure){
        this.mProcedures.add(procedure);
        
    }

    /**
     * @return the appointments
     */
    public List<Appointment> getAppointments() {
        return appointments;
    }

    /**
     * @param appointments the appointments to set
     */
    public void setAppointments(List<Appointment> appointments) {
        this.appointments = appointments;
    }

    /**
     * @return the dischargeSummary
     */
    public DischargeSummary getDischargeSummary() {
        return dischargeSummary;
    }

    /**
     * @param dischargeSummary the dischargeSummary to set
     */
    public void setDischargeSummary(DischargeSummary dischargeSummary) {
        this.dischargeSummary = dischargeSummary;
    }

    /**
     * @return the medicalAnamnesis
     */
    public Medical_Anamnesis getMedicalAnamnesis() {
        return medicalAnamnesis;
    }

    /**
     * @param medicalAnamnesis the medicalAnamnesis to set
     */
    public void setMedicalAnamnesis(Medical_Anamnesis medicalAnamnesis) {
        this.medicalAnamnesis = medicalAnamnesis;
    }

    /**
     * @return the nursingAnamnesis
     */
    public Nursing_Anamnesis getNursingAnamnesis() {
        return nursingAnamnesis;
    }

    /**
     * @param nursingAnamnesis the nursingAnamnesis to set
     */
    public void setNursingAnamnesis(Nursing_Anamnesis nursingAnamnesis) {
        this.nursingAnamnesis = nursingAnamnesis;
    }
   
}
